using Vwf.Web;

namespace Vwf.Web.Controls {
	public abstract class ControlList : ArrayList<Control> {
		public Control? separator = null;
		public Control? header = null;
		public Control? footer = null; 
		public Control? emptyContent = null;
		
		public void render(Writer writer) {
			if ((size == 0) && (emptyContent != null)) {
				emptyContent.render(writer);
			} else {
				if (header != null) header.render(writer);
				foreach(var item in this) {
					item.render(writer);
				};
				if (footer != null) footer.render(writer);
			}	
		}
	}
}
